package com.flyan.game.motafx.event;

import com.flyan.game.motafx.core.event.BaseEvent;
import com.flyan.game.motafx.core.event.enums.EventTypeEnum;
import com.flyan.game.motafx.core.map.info.EntityProperty;
import com.flyan.game.motafx.core.util.core.GameUtils;

/**
 * 移除游戏实体
 *
 * @author flyan
 * @version 1.0
 * @email flyan_by_chenu@sina.com
 * @since 2025/2/11
 */
public class RemoveEntityEvent extends BaseEvent {

    @Override
    public String type() {
        return EventTypeEnum.REMOVE_ENTITY.getCode();
    }

    @Override
    public void occur() {
        Integer floorNumber = properties.getInt("floorNumber");
        EntityProperty.EntityPosition position = properties.get("position",
                EntityProperty.EntityPosition.class);
        GameUtils.app().towerMap.getFloor(floorNumber).removeEntity(position);
    }

}
